home *** CD-ROM | disk | FTP | other *** search
-
-
- func(int type)
- {
- /* Begin critical section */
- lock();
- switch(type)
- {
- case 1:
- /*** Do work for type code 1 ***/
- /*** End critical section ***/
- unlock();
- return(SUCCESS);
-
- case 2:
- /*** Do work for type code 2 ***/
- /*** End critical section ***/
- unlock();
- return(SUCCESS);
-
- default:
- if(type > 5)
- {
- /*** End critical section ***/
- unlock();
- return(ERROR);
- }
- /*** Do default work ***/
- /*** End critical section ***/
- unlock();
- return(SUCCESS);
- }
- }
-
-
-